<?php
namespace app\manage\controller;

use app\manage\model\Logins;

use think\Controller;
class Login extends Controller
{
    public function loginindex()
    {
        if(null!==input('submit'))
        {
            $account = input('account');
            $root    = input('root');
            $yzmtp   = input('yzm');
            if($yzmtp=='true')
            {
                $login = new Logins;
                $db = $login->login($account,$root);
                if($db==1)
                { 
                    $this->success('登录成功！','manage/index/index');
                }
                elseif($db==2){
                    $this->error('您不是团长！');
                }
                elseif($db==3){
                    $this->error('密码错误！');
                }
                elseif($db==4){
                    $this->error('账号不存在！');
                }
            }
        }
        return view('login');
    }
}